Skip to content

fix: Skip Azure Monitor profiler on unsupported OS#1113

Merged
BenjaminMichaelis merged 1 commit into
mainfrom
benjaminmichaelis/mac-startup-failure
May 16, 2026
Merged

fix: Skip Azure Monitor profiler on unsupported OS#1113
BenjaminMichaelis merged 1 commit into
mainfrom
benjaminmichaelis/mac-startup-failure

Conversation

@BenjaminMichaelis
Copy link
Copy Markdown
Member

Why

AddAzureMonitorProfiler() is only supported on Windows and Linux. On macOS, enabling Azure Monitor caused startup to fail with System.NotSupportedException.

What changed

  • Gate profiler registration to supported platforms (OperatingSystem.IsWindows() or OperatingSystem.IsLinux()).
  • Keep UseAzureMonitor() enabled so telemetry export still works cross-platform.
  • Add a structured warning log when profiler registration is skipped on unsupported platforms.

Result

The app no longer fails at startup on macOS due to profiler registration, while Azure Monitor telemetry remains enabled.

Gate AddAzureMonitorProfiler() to Windows/Linux while keeping Azure Monitor export enabled on all platforms, and log when profiler registration is skipped.
Copilot AI review requested due to automatic review settings May 16, 2026 01:44
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes a startup failure on macOS by skipping AddAzureMonitorProfiler() registration on unsupported platforms while keeping UseAzureMonitor() enabled for cross-platform telemetry export.

Changes:

  • Gate profiler registration on OperatingSystem.IsWindows() || OperatingSystem.IsLinux().
  • Track when profiler is skipped and emit a structured warning log with OS description.
  • Add a new [LoggerMessage] partial method for the warning.

@BenjaminMichaelis BenjaminMichaelis changed the title Skip Azure Monitor profiler on unsupported OS fix: Skip Azure Monitor profiler on unsupported OS May 16, 2026
@BenjaminMichaelis BenjaminMichaelis merged commit 2b3aa37 into main May 16, 2026
12 checks passed
@BenjaminMichaelis BenjaminMichaelis deleted the benjaminmichaelis/mac-startup-failure branch May 16, 2026 02:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants